Skip to content

读取图片PNG字节流 - GetImagePngData

函数简介

获取指定图像,用PNG数据格式返回。

接口名称

GetImagePngData

DLL调用

int GetImagePngData(long ola, long ptr, long* data, int* size);

参数说明

参数名类型说明
ola长整数型OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。
ptr长整数型OLAImage对象的地址
data长整数型指针返回图片的数据指针
size整数型指针返回图片的数据长度

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.GetImagePngData(0, "value", "value");
csharp
using OLAPlug;

var ola = new OLAPlugServer();
int ret = ola.GetImagePngData(0, "value", "value");
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ret = ola.GetImagePngData(0, "value", "value")
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
int ret = ola.GetImagePngData(0, "value", "value");
cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.GetImagePngData(0, "value", "value")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.GetImagePngData(0, "value", "value")
text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.GetImagePngData(0, “value”, “value”)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.GetImagePngData(0, "value", "value");
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.GetImagePngData(0, "value", "value")
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int32_t ret = ola.GetImagePngData(0, "value", "value");

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
GetImagePngData(instance, 0, 0, 0);
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int GetImagePngData(long ola, long ptr, long data, int size);

long instance = CreateCOLAPlugInterFace();
GetImagePngData(instance, 0, 0, 0);
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ola.GetImagePngData(instance, 0, 0, 0)

返回值

整数型:1 成功,0 失败。

注意事项

  • 使用完成需调用 FreeImageData 接口释放内存。